-
Notifications
You must be signed in to change notification settings - Fork 41
Add Prettier to keep code consistent. #33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
ailisp
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is a reasonable configuration. Do we need to keep this consistent as other NEAR JavaScript Libraries' setup (if any)? @volovyk-s
|
Wow, Awesome contribution @tbezman ! We definitely need to add GitHub actions here.
I would rather use default parameters for Prettier and not override them with a separate config file. More chances that it will not be in conflict with text editors and IDEs. Bonus points for adding Unit tests GitHub Action (just run |
|
Thanks for getting back to me. I'll apply all of this feedback ASAP. |
|
@volovyk-s Yeah there is a config we can use to disable all eslint rules around code formatting so we can use prettier for formatting, and eslint for code conventions. I think I'll save the ESLint configuration for an upcoming PR since we have a bunch of warnings atm. I'll do the eslint stuff as a followup. |
|
Okay @volovyk-s, I updated the PR. I removed the prettier config (now we're using prettier defaults), and added unit tests to the github action workflow. I think you'll have to make the action a required check on PRs after this merges. |
volovyks
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome @tbezman! And thank you for the tests.
NP: When I run yarn pretty:check I'm not getting any errors, but yarn pretty command generates some formatting changes. Can you please run it and push changes?
|
@volovyk-s On this branch, when I run |
|
@tbezman I have double-checked. All good, thank you! |
|
Hm, it's getting changed after |
|
Test and pretty (with small fix) GitHub actions works! |
Hoping this a welcome addition. I added prettier and setup a config file that closely matches the existing code style that already existed. I'm also only checking
index.tsfor now which seems like one of our only TypeScript source files.I also setup the repo's first Github Action to ensure code is properly formatted from people posting PRs.